package com.mowanka.mokeng.ui.fragment.trading

import android.os.Bundle
import androidx.fragment.app.Fragment
import com.mowanka.mokeng.app.base.BaseFragment
import com.mowanka.mokeng.app.ext.bindViewPager2
import com.mowanka.mokeng.app.ext.init
import com.mowanka.mokeng.databinding.FragmentTradingHomeBinding
import com.mowanka.mokeng.ui.home.HomeFragment
import me.hgj.jetpackmvvm.base.viewmodel.BaseViewModel

class TradingHomeFragment : BaseFragment<BaseViewModel, FragmentTradingHomeBinding>() {

    var title = arrayListOf("官转", "二手", "求购", "拍卖")

    private var fragments = arrayListOf<Fragment>()

    init {
        fragments.add(TransSecondHandFragment(0))
        fragments.add(TransSecondHandFragment(1))
        fragments.add(HomeFragment())
        fragments.add(HomeFragment())
    }

    override fun initView(savedInstanceState: Bundle?) {
        mDatabind.viewPager.init(this, fragments)
        mDatabind.magicIndicator.bindViewPager2(mDatabind.viewPager, title)
    }
}